#ifndef _OPTION_H_
#define _OPTION_H_

#ifdef _WIN32
#pragma once
#endif

#include <string>

#include "ui_text.h"
#include "utils.h"
//#include "spritemanager.h"

using std::string;
using utils::PARAM;
using utils::typeDefinitions;

typedef vector<PARAM> DELAY_PARAMS;

class CMenu;

class COption : public CUIText
{
public:
    COption(int nIndex, const string &szOptionText);

    void setActiveColour(float red, float green, float blue, float alpha);
    void setInactiveColour(float red, float green, float blue, float alpha);
    void getActiveColour(float &red, float &green, float &blue, float &alpha);
    void getInactiveColour(float &red, float &green, float &blue, float &alpha);

    virtual void setActive(bool active);
    bool getActive();

    void setFunction(void (*function)(CMenu *, COption *, DELAY_PARAMS &, 
        unsigned char));
    virtual void callFunction(CMenu *pMenu, unsigned char chKey);

    void registerParam(void *pData, utils::TYPE_VALUE nType, int nSize);

    string getOriginalText() const;

    int getIndex() const;

protected:
    DELAY_PARAMS m_arrParams;
    bool m_bActive;

private:
    void (*m_pFunction)(CMenu *, COption *, DELAY_PARAMS &params,
        unsigned char chKey);
    string m_szOriginalText;
    int m_nIndex;
    float m_fActiveRed;
    float m_fActiveGreen;
    float m_fActiveBlue;
    float m_fActiveAlpha;

    float m_fInactiveRed;
    float m_fInactiveGreen;
    float m_fInactiveBlue;
    float m_fInactiveAlpha;
};

#endif